//
// Created by Administrator on 2023/11/23.
//
#include "iostream"

using namespace std;

const int N = 1e5 + 10;
int a[N];

int partition(int low, int high) {

    int pivot = a[low];
    while (low < high) {
        while (low < high && a[high] >= pivot) high--;
        a[low] = a[high];
        while (low < high && a[low] <= pivot) low++;
        a[high] = a[low];
    }
    a[low] = pivot;
    return low;
}

void quick_sort(int low, int high) {
    if (low < high) {
        int pivotPos = partition(low, high);
        quick_sort(low, pivotPos - 1);
        quick_sort(pivotPos + 1, high);
    }
}

//以上是王道方法
//下边其实一样
void quick_sort_2(int l, int r) {
    if (l >= r) return;

    int piv = a[l + ((r - l) >> 1)];
    int i = l, j = r;
    while (i <= j) {
        while (a[i] < piv) i++;
        while (a[j] > piv) j--;
        if (i <= j) swap(a[i++], a[j--]);
    }

    quick_sort(l, j), quick_sort(i, r);
}



int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    quick_sort(0, n - 1);
    for (int i = 0; i < n; ++i) {
        cout << a[i] << " ";
    }
}